home *** CD-ROM | disk | FTP | other *** search
/ Champak 66 / Vol 66.iso / games / bluep.swf / scripts / __Packages / mx / transitions / BroadcasterMX.as next >
Text File  |  2013-04-24  |  2KB  |  65 lines

  1. class mx.transitions.BroadcasterMX
  2. {
  3.    static var version = "1.1.0.52";
  4.    function BroadcasterMX()
  5.    {
  6.    }
  7.    static function initialize(o, dontCreateArray)
  8.    {
  9.       if(o.broadcastMessage != undefined)
  10.       {
  11.          delete o.broadcastMessage;
  12.       }
  13.       o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
  14.       o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
  15.       if(!dontCreateArray)
  16.       {
  17.          o._listeners = new Array();
  18.       }
  19.    }
  20.    function addListener(o)
  21.    {
  22.       this.removeListener(o);
  23.       if(this.broadcastMessage == undefined)
  24.       {
  25.          this.broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
  26.       }
  27.       return this._listeners.push(o);
  28.    }
  29.    function removeListener(o)
  30.    {
  31.       var _loc2_ = this._listeners;
  32.       var _loc3_ = _loc2_.length;
  33.       while(true)
  34.       {
  35.          _loc3_;
  36.          if(!_loc3_--)
  37.          {
  38.             break;
  39.          }
  40.          if(_loc2_[_loc3_] == o)
  41.          {
  42.             _loc2_.splice(_loc3_,1);
  43.             if(!_loc2_.length)
  44.             {
  45.                this.broadcastMessage = undefined;
  46.             }
  47.             return true;
  48.          }
  49.       }
  50.       return false;
  51.    }
  52.    function broadcastMessage()
  53.    {
  54.       var _loc5_ = String(arguments.shift());
  55.       var _loc4_ = this._listeners.concat();
  56.       var _loc6_ = _loc4_.length;
  57.       var _loc3_ = 0;
  58.       while(_loc3_ < _loc6_)
  59.       {
  60.          _loc4_[_loc3_][_loc5_].apply(_loc4_[_loc3_],arguments);
  61.          _loc3_ = _loc3_ + 1;
  62.       }
  63.    }
  64. }
  65.